import request from '@/utils/request'

// 电梯登记信息 添加电梯
export function elevatorCreateAdd(data) {
  return request({
    url: '/masterdata/maElevator/add',
    method: 'post',
    params: {},
    data,
    port: { ENV_PORT: 8003 },
    ajaxType2: 'reqPost'

  })
}

// 删除电梯
export function elevatorDelete(id) {
  return request({
    url: '/masterdata/maElevator/delete',
    method: 'delete',
    params: { id },
    port: { ENV_PORT: 8003 },
    ajaxType2: 'reqDelete'

  })
}

// 电梯详情
export function elevatorDetail(id) {
  return request({
    url: '/masterdata/maElevator/detail',
    method: 'get',
    params: { id },
    port: { ENV_PORT: 8003 },
    ajaxType2: 'reqGet'

  })
}

// 电梯实时监控详情
export function monitorDetail(id) {
  return request({
    url: '/masterdata/maRealtimeMonitor/detail',
    method: 'get',
    params: { id },
    port: { ENV_PORT: 8003 },
    ajaxType2: 'reqGet'

  })
}

// 电梯导入
export function importElevator(importFile) {
  return request({
    url: '/masterdata/maElevator/importElevator',
    method: 'post',
    data: importFile,
    port: { ENV_PORT: 8003 },
    ajaxType: 'formdata',
    ajaxType2: 'reqPost'
  })
}

// 电梯列表
export function elevatorQueryList(bindState, id, maintenanceUnitId, pageIndex, pageSize, registerCode, registerUnit, rescueCode, useUnitId) {
  return request({
    url: '/masterdata/maElevator/queryList',
    method: 'get',
    params: { bindState, id, maintenanceUnitId, pageIndex, pageSize, registerCode, registerUnit, rescueCode, useUnitId },
    port: { ENV_PORT: 8003 },
    ajaxType2: 'reqGet'
  })
}

// 修改电梯
export function elevatorUpdate(data) {
  return request({
    url: '/masterdata/maElevator/update',
    method: 'put',
    data,
    port: { ENV_PORT: 8003 },
    ajaxType2: 'reqPut'
  })
}

// 查询电梯实时监控详情
export function realtimeDetail(id) {
  return request({
    url: '/masterdata/maRealtimeMonitor/detail',
    method: 'get',
    params: { id },
    port: { ENV_PORT: 8003 },
    ajaxType2: 'reqGet'
  })
}

// 查询电梯实时监控详情列表
export function realtimeDetailList(params) {
  return request({
    url: '/masterdata/maRealtimeMonitor/queryList',
    method: 'get',
    params: {
      'multiIds': params.multiIds,
      'pageIndex': params.pageIndex,
      'pageSize': params.pageSize
    },
    port: { ENV_PORT: 8003 },
    ajaxType2: 'reqGet'
  })
}
